-
-
Notifications
You must be signed in to change notification settings - Fork 605
Speedup CI #1852
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Speedup CI #1852
Conversation
This reverts commit 58a95b0.
It turned out that the target was indeed being installed but it was cached across the different rust channels (1.65, stable, nightly) and I happened to not check the one which ran first, leading to my confusion.
can you make sure |
I can take a look at that sometime today/tomorrow as well |
I merged f639f4a and c38b1d1 into my fork and here's some more numbers: The fork's master branch was included as a sanity check to make sure that it has roughly the same times as the original repo (which it should as I have not modified it). Somehow it ended up being a bit slower, go figure. The original repo shows 2 times as each commit was pushed separately unlike my fork where both were pushed together. The great news is that this also improves the Overall, this seems to be quite a bit faster, at least in these 2 commits that I tested it on. I won't be able to really test the CD workflow but I'll make the same changes there nontheless. |
would like to put this into action in |
I'll definitely try to have it ready by then so I can see it tested as well. |
I checked the actions used in the CD workflow and made sure they are either on their latest version + switched the toolchain one as I did in the CI workflow earlier. I also opted to use Lastly, by getting CD to use the same cache key format, it should benefit from the fresh cache that CI created in the last commit. |
I changed from the I'm gonna wait for the cache to warm up and run the workflow once more on an empty commit to make sure nothing changed in the times. After that, I think everything is done from my side so far, let me know! |
This actually seems to worsen performance as sometimes the cache is not properly saved since multiple jobs are trying to access it at the same time
To get around this, I will only keep the shared keys for one of the CI jobs (which is really all that was needed, in retrospect). Taking a look at the latest CD run it seems that most of the time is actually spent building for windows and not arm which I would initially expect. This means that sharing the cache from the |
This last change has made CI run in ~10 minutes again like last time so it seems to be working fine again. This should also benefit CD heavily, to make sure that the cache is being utilized correctly when we do run CD we should check that the key for One small issue with this is that CI currently does not run on |
Finally, I also added caching in the In the best case scenario, CI can take as little as 8m 19s which is over an hour of total runtime less than the existing workflow Initially, I wasn't planning on adding this but it seems that with no code changes they actually take more time than all other steps. Sorry for the influx of comments, I hadn't done some of this stuff before 😅 |
Thank you! |
This Pull Request closes #1844.
Changes
Fix Warnings
actions/checkout@v3
actions-rs/toolchain
(not maintained) todtolnay/rust-toolchain
actions-rs/audit-check
(not maintained) torustsec/audit-check
These changes resolved all the warnings.
Caching
Used
rust-cache
as mentioned in the issue.I kept the
cache-name
around and added atarget
variable as well.Is it any better?
I think the best way to figure that out would be to wait for another commit to be made to master which I can merge to my fork so we can compare the CI times between that and the original.
I forked at b36ffc9 and here's some numbers
I would guess that the warm cache time is more representative of the change since, well, the original repository should also have a warm cache. But again, a more serious comparison would be to wait for the next commit.
And also not having a wall of warnings makes it easier to spot any that are actually relevant when they appear 😅
Other
I also mention this in the
yml
itself but for some reason there seems to be some issue with thex86_64-unknown-linux-musl
target and thedtolnay/rust-toolchain
action.Even though the rustup target should be installed, the subsequent build fails. I instead install it manually which works fine (it is also cached so subsequent runs don't suffer).
Let me know if you have any questions or want any changes made!
Also the last CI run after I changed a comment decided to fail due to a timeout, I'm guessing because I've been running it quite a few times in the last few hours. Anyway, seems unrelated + i ran the failed task again and it worked fine